﻿
@{
    Layout = null;
}
@using Model
@model salary_standard
<link rel="stylesheet" href="~/css/table.css" type="text/css">
<script src="~/jquery-easyui-1.3.5/jquery-1.11.1.js"></script>
<script src="~/Js/jquery.validate.js"></script>
<script src="~/Js/jquery.validate.unobtrusive.js"></script>
<script src="~/Js/jquery.unobtrusive-ajax.js"></script>
<script src="~/js/vue.js"></script>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>无标题文档</title>
    <link rel="stylesheet" href="../../css/table.css" type="text/css">
    <link rel="stylesheet" type="text/css" media="all"
          href="../../javascript/calendar/calendar-win2k-cold-1.css">
    <script type="text/javascript" src="../../javascript/calendar/cal.js"></script>
    <script type="text/javascript" src="../../javascript/comm/comm.js"></script>
    <script type="text/javascript" src="../../javascript/comm/list.js"></script>
    <script type="text/javascript" src="../../javascript/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="../../javascript/calendar-ch.js"></script>
    <script type="text/javascript" src="../../javascript/comm/time.js"></script>
    <link rel="stylesheet" href="../../css/cwcalendar.css" type="text/css">

</head>

<div id="app">
    <form method="post" asp-action="salarystandard_change_listEdit">

        <input type="hidden" name="standard.ssdId" value="1259">

        <table width="100%">
            <tr>
                <td>
                    <font color="#0000CC">您正在做的业务是:人力资源管理--薪酬标准管理--薪酬标准登记变更</font>
                    @*<input type="hidden" value="@ViewBag.s" name="id" />*@
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <input type="submit" value="重新提交" class="BUTTON_STYLE1">
                        <input type="button" value="返回" onclick="history.back();" class="BUTTON_STYLE1">
                    </div>
                </td>
            </tr>
        </table> 
       
        <table width="100%" border="1" cellpadding=0 cellspacing=1
               bordercolorlight='#848284' bordercolordark='#eeeeee'
               class="TABLE_STYLE1">
            <tr>
                <td width="12%" class="TD_STYLE1">
                    薪酬编号
                    
                </td>
                <td width="15%" class="TD_STYLE2">
                    <input type="hidden" asp-for="Id" />
                    <input type="hidden" asp-for="register" />
                    <input type="hidden" asp-for="regist_time" />
                    <input type="hidden" asp-for="remark" />
                    <input type="text" asp-for="standard_id" id="id" readonly="readonly" />
                </td>
                <td width="12%" class="TD_STYLE1">
                    薪酬标准名称
                </td>
                <td width="11%" class="TD_STYLE2">
                    <input type="text" asp-for="standard_name" id="standardName" class="INPUT_STYLE2">
                    <span asp-validation-for="standard_name"></span>
                </td>
                <td width="11%" class="TD_STYLE1">
                    薪酬总额
                </td>
                <td width="17%" class="TD_STYLE2">
                    <input type="text" asp-for="salary_sum" id="_salary_sum" readonly class="INPUT_STYLE2" />
                </td>
                <td width="12%" class="TD_STYLE1">
                    &nbsp;
                </td>
                <td width="10%" class="TD_STYLE2">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="TD_STYLE1">
                    制定人
                </td>
                <td class="TD_STYLE2">
                    <input type="text" asp-for="designer" id="designer" class="INPUT_STYLE2" placeholder="请输入制定人">
                    <span asp-validation-for="designer"></span>
                </td>
                <td class="TD_STYLE1">
                    变更人
                </td>
                <td class="TD_STYLE2">
                    <input type="text" asp-for="changer" class="INPUT_STYLE2">
                    <input type="hidden" asp-for="checker">
                </td>
                <td class="TD_STYLE1">
                    变更时间
                </td>
                <td class="TD_STYLE2">
                    <input type="text" asp-for="change_time" id="Tdate" class="INPUT_STYLE2">
                    <input type="hidden" asp-for="check_time">
                </td>
                <td class="TD_STYLE1">
                    &nbsp;
                </td>
                <td class="TD_STYLE2">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="TD_STYLE1">
                    备注
                </td>
                <td colspan="7" class="TD_STYLE2">
                    <textarea asp-for="remark" rows="4" class="INPUT_STYLE2"></textarea>
                    <input type="hidden" asp-for="check_comment">

                </td>
            </tr>
            <tr>
                <td class="TD_STYLE1">
                    序号
                </td>
                <td colspan="3" class="TD_STYLE1">
                    薪酬项目名称
                </td>
                <td colspan="4" class="TD_STYLE1">
                    金额
                </td>
            </tr>
            <tbody id="td1">
            </tbody>


        </table>
    </form>
</div>
<script type="text/javascript">
    function check() {
        var designer = document.getElementById("designer");
        var standardName = document.getElementById("standardName");
        if (designer.value.length <= 0) {
            alert("制定人不可为空!!!");
            return;
        }
        if (standardName.value.length <= 0) {
            alert("薪酬标准名称不可为空!!!");
            return;
        }
        document.forms[0].submit();
    }
    $(document).on("keyup", "input[id='salary']", function () {
        var t = this;
        var shu = $(this).val();
        if (isNaN(shu) || shu < 0) {
            alert("金额填写错误!");
            t.val("0.00");
        }
        var sum = 0;
        var zz = $('input[id=salary]').length;
        for (var i = 0; i < zz; i++) {
            var salary = $("input[id='salary']").eq(i).val();
            if (salary == "") {
                salary = "0.00";
            }
            sum = Number(sum) + Number(salary);
        }
        document.getElementById("salary_sum").value = sum;
    })
    function time() {
        var tdate = document.getElementById("Tdate");
        var d = new Date();
        var y = d.getFullYear();
        var moth = d.getMonth() + 1;
        var date = d.getDate();
        var h = d.getHours();
        var m = d.getMinutes();
        var s = d.getSeconds();
        var hh = 20 - 1 - h;
        var mm = 60 - 1 - m;
        var ss = 60 - s;
        if (hh > 0) {
            mm = mm + 60 * hh;
        }
        if (moth < 10) {
            moth = "0" + moth;
        }
        if (date < 10) {
            date = "0" + date;
        }
        if (h < 10) {
            h = "0" + h;
        }
        if (m < 10) {
            m = "0" + m;
        }
        if (s < 10) {
            s = "0" + s;
        }
        if (mm < 10) {
            mm = "0" + mm;
        }
        if (ss < 10) {
            ss = "0" + ss;
        }

        tdate.value = y + "-" + moth + "-" + date + " " + h + ":" + m + ":" + s;

    }
    window.onload = time;
    var out = window.setInterval(time, 1000);
    var vm = new Vue({
        el: "#app",
        data: {
            dt: []
        },
        methods: {
            fill: function () {
                var t = this;
                var id = $("input[id='id']").val();
                $.ajax({
                    url: "/salaryCriterion/Index3",
                    data: "id=" + id,
                    type: "get",
                    success: function (msg) {
                        var d = eval("(" + msg + ")");
                        for (var i = 0; i < d.length; i++) {
                            var $tr = $("<tr class='TD_STYLE2'></tr>");
                            var $td1 = "<td><input type='hidden' value='" + d[i].Id + "' name='Id' /><input type='hidden' value='" + d[i].item_id + "' name='item_id' />" + d[i].item_id + "</td><td colspan='3'><input type='hidden' value='" + d[i].item_name + "' name='item_name' />" + d[i].item_name + "</td><td><input type='text' id='salary' value='" + d[i].salary + "' name='salary' class='INPUT_STYLE2' readonly='readonly'></td><td colspan='3'>&nbsp;</td>";
                            $tr.append($td1);
                            $("#td1").append($tr);
                        }
                    }
                });
            },
        },
        mounted: function () {
            this.fill();
        }
    });
</script>